package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
  

    @Select("select count(1) from dish where category_id = #{id}")
    int countByCategoryId(Long id);

    List page(DishPageQueryDTO dishPageQueryDTO);

    @AutoFill(value = OperationType.INSERT)
    void save(Dish dish);

    void delete(List<Long> ids);

    Dish getById(Long id);
    @AutoFill(value = OperationType.UPDATE)
    void update(Dish dish);

    List listBycategoryId(Integer categoryId);
    @AutoFill(value = OperationType.UPDATE)
    void permission(Integer status, Long id);

    List<SetmealDish> listBySetmealId(Long id);
}
